from rest_framework import serializers
from home.models import NavModel,BannerModel
class NavSerializer(serializers.ModelSerializer):
    class Meta:
        model = NavModel
        # fields = '__all__' #序列化所有字段
        fields = ['name','link','is_http']#序列化指定字段

class BanerSerializer(serializers.ModelSerializer):
    class Meta:
        model = BannerModel
        # fields = "__all__"
        fields = ['name','link','is_http','image']
